
import java.util.Scanner;

public class C_1_13_45 {
    public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
       Integer tmp = sc.nextInt();
       System.out.println(Integer.toString(tmp,8));
    }
}